package com.mxpio.erp.inventory.provider;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.mxpio.erp.common.inventory.service.LotService;
import com.mxpio.erp.common.jpa.model.Notice;
import com.mxpio.erp.common.order.policy.NoticeContext;
import com.mxpio.erp.common.order.provider.NoticeContextProvider;

@Component
public class DefaultNoticeContextProvider implements NoticeContextProvider {

	@Autowired
	private LotService lotService;

	@Override
	public boolean supports(Class<?> clazz) {
		if(Notice.class.isAssignableFrom(clazz)) {
			return true;
		}
		return false;
	}

	@Override
	public void provide(NoticeContext context) {
		context.setLotService(lotService);
	}

}
